/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ua.yandex.skipasssystem.skipass;

import java.util.Date;
import ua.yandex.skipasssystem.SkiPassSystem;

/**
 *
 * @author Mitya
 */
public class SkiPassFactory {

    private final SkiPassSystem skiPassSystem;

    public SkiPassFactory(SkiPassSystem skiPassSystem) {
        this.skiPassSystem = skiPassSystem; 

    }

    public SkiPass makeWorkDaySkiPassLimited(Date activationDate,
            Date expirationDate, NumberOfRides numberOfRides) {
        
        SkiPass skiPass = new WorkDaySkiPassLimited(activationDate, 
                expirationDate, numberOfRides);
        
       skiPassSystem.addSkiPass(skiPass);
       return skiPass;
    }
    
    public SkiPass makeWorkDaySkiPassUnlimited(Date activationDate, 
            DurationOfRides durationOfRides) {
        SkiPass skiPass =
            new WorkDaySkiPassUnlimited(activationDate, durationOfRides);
        skiPassSystem.addSkiPass(skiPass);
        return  skiPass;
    }
    
    public SkiPass makeDayOffSkiPassLimited(Date activationDate, 
            Date expirationDate, NumberOfRides numberOfRides) {
        SkiPass skiPass = 
            new DayOffSkiPassLimited(activationDate, expirationDate, 
                    numberOfRides);
        skiPassSystem.addSkiPass(skiPass);
        return  skiPass;
    }
    
    public SkiPass  makeDayOffSkiPassUnlimited(Date activationDate,
            DurationOfRides durationOfRides) {
        
        SkiPass skiPass = new DayOffSkiPassUnlimited(activationDate, 
                durationOfRides);
        skiPassSystem.addSkiPass(skiPass);
        return skiPass;
    }
    
    public SkiPass makeSeasonSkiPass(Date activationDate) {
        SkiPass skiPass = new SeasonSkiPass(activationDate);
        skiPassSystem.addSkiPass(skiPass);
        return skiPass;
    }
}
